package com.njupt.threshold;

import com.njupt.Tree.TreeNode;

/**
 * @Author wujiaming
 * @Description TODO
 * @Date 2023-03-07 15:26
 * @Version 1.0
 */
public class MaxDepth {

    public static int maxDepth;


    public int maxDepth(TreeNode root) {
        if(root==null){
            return 0;
        }
        int lDepth = maxDepth(root.left);
        int rDepth = maxDepth(root.right);
        return lDepth<rDepth?rDepth+1:lDepth+1;
    }

    public static void main(String[] args) {

    }
}
